// 没有返回值时才调用下一个方法
module.exports = class SyncBailHook {
    constructor() {
        this.tasks = []
    }
    tap(name, callback) {
        this.tasks.push(callback);
    }
    call(...args) {
        let index = 0;
        let res;
        do {
            let task = this.tasks[index++];
            res = task(...args)
        } while (res === undefined && index < this.tasks.length)
    }
}